<template>
  <div class="home">
    home
    {{gloLoginUser}}
  </div>
</template>

<script>
// @ is an alias to /src
import actions from '@/actions/actions'


export default {
    name: 'Home',
    components: {
    },
    mounted() {
        console.log('child1:actions:', actions);
        // 注册观察者函数
        // onGlobalStateChange 第二个参数为 true，表示立即执行一次观察者函数
        actions.onGlobalStateChange(state => {
            const { type } = state;
            console.log(type);
            console.log('state:', state);
        }, true);
    },
    computed: {
    	// 弹窗显隐
    	gloLoginUser () {
    		console.log(this.$store.state)
    		return this.$store.state.gloLoginUser;
    	},
    },
}
</script>
